 <?php

 function getpage($count, $pagesize = 10) {
 	$p = new Think\Page($count, $pagesize);
 	$p->setConfig('header', '<li class="rows">共<b>%TOTAL_ROW%</b>条记录&nbsp;第<b>%NOW_PAGE%</b>页/共<b>%TOTAL_PAGE%</b>页</li>');
 	$p->setConfig('prev', '上一页');
 	$p->setConfig('next', '下一页');
 	$p->setConfig('last', '末页');
 	$p->setConfig('first', '首页');
 	$p->setConfig('theme', '%FIRST%%UP_PAGE%%LINK_PAGE%%DOWN_PAGE%%END%%HEADER%');
 	$p->lastSuffix = false;//最后一页不显示为总页数
 	return $p;
 }

 function arr2str ($arr)
	{
	    foreach ($arr as $v)
	    {
	        $v = join(",",$v); //可以用implode将一维数组转换为用逗号连接的字符串
	        $temp[] = $v;
	    }
	    $t="";
	    foreach($temp as $v){
	        $t.= $v.",";
	    }
	    $t=substr($t,0,-1);
	    return $t;
	}

function check_verify($code, $id = ""){  
    $verify = new \Think\Verify();  
    return $verify->check($code, $id);  
}  	

function format_bytes($size, $delimiter = '') {
    $units = array('B', 'KB', 'MB', 'GB', 'TB', 'PB');
    for ($i = 0; $size >= 1024 && $i < 5; $i++) $size /= 1024;
    return round($size, 2) . $delimiter . $units[$i];
}
function store_status($status)
{
	 switch ($status) {
                case '0':
                    return '未审核';
                    break;
                
                 case '1':
                    return '通过';
                    break;
                
                 case '-1':
                    return '未通过';
                    break;
                
                default:
                    # code...
                    break;
            }
}
